<template>
  <div>
    <h2>我总共有：{{moneyCount}}  元</h2>
    <button @click="eat">吃饭花了100元</button>
    <!-- 在模板里不需要用this -->
    <button @click="moneyCount-=60">买零食花了60元</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      moneyCount: 0
    }
  },
  methods: {
    eat() {
      this.moneyCount -= 100
    }
  }
}
</script>